#ifndef ALGORITHMSTESTS_H
#define ALGORITHMSTESTS_H

#include "stdafx.h"
#include "TestUtils.h"
#include "Chain.h"
#include "Input.h"
#include "./Markup/Markup.h"
#include <cstdlib>


// tries to improve the chain by running the greedy FillSIngles algorithm on each of its groups 
TestUtils::TestResult ImproveChainBySingleFillingOfGroups(int n, int w, Chain& chain, int Algorithm, InputVariables* inputVariables, int startImprovingIndex);

// tries to add groups to the chain by running the algorithm specified in algorithm 
TestUtils::TestResult FindNextGroupInChain(int n, int w, int algorithm, int NumberOfGroupsToFind, Chain& chain, InputVariables* inputVariables, bool improveGroup = false);

// helper functions for the various tests
void UpdateOriginalChainFromCopy(Chain& originalChain, Chain& copyChain);

TestUtils::TestResult RunAlgorithm(Graph& graph, Group& group, int Algorithm, InputVariables* inputVariables, VertexDirectory* dir);

TestUtils::TestResult ImproveSingleGroup(Group& group, Chain& chain, int algorithm, VertexDirectory* dir, InputVariables* inputVariables);

// Runs the specified algorithm to create a new group to add to chain and returns a new chain with an extra group
Chain *UseAlgorithmToAddToChain(Chain *oldChain, int algorithm, int groupIndex, InputVariables *inputVariables);

#endif //ALGORITHMSTESTS_H